home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1995 August / PC Plus Super CD (Issue 106) (PCP106) (August 1995).iso / picpub / cms / cmsdisk1 / starter.mst < prev    next >
Encoding:
Text File  |  1994-12-08  |  5.8 KB  |  250 lines

  1. '**************************************************************************
  2. '*     MSSetup Script for the KODAK PRECISION MICROGRFX Starter Pack
  3. '**************************************************************************
  4.  
  5. '$DEFINE DEBUG  ''Define for script development/debugging
  6.  
  7. '$INCLUDE 'setupapi.inc'
  8. '$INCLUDE 'msdetect.inc'
  9. '$INCLUDE 'msshared.inc'
  10.  
  11. ''Dialog ID's
  12. CONST WELCOME    = 100
  13. CONST ASKQUIT    = 200
  14. CONST TOOBIG    = 400
  15.  
  16. CONST WINDOWSVERSION    = 600
  17. CONST WINDOWSMODE        = 610
  18. CONST PROCESSOR            = 620
  19.  
  20. CONST EXITFAILURE    = 700
  21. CONST EXITQUIT        = 710
  22. CONST EXITSUCCESS    = 720
  23.  
  24. ''Bitmap ID
  25. CONST LOGO = 1
  26.  
  27. GLOBAL WinDir$
  28. GLOBAL WinSysDir$
  29.  
  30. DECLARE SUB Install
  31. DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
  32.  
  33.  
  34. INIT:
  35.     CUIDLL$ = "mscuistf.dll"            ''Custom user interface dll
  36.  
  37.     SetBitmap CUIDLL$, LOGO
  38.     SetTitle "KODAK PRECISION MICROGRAFX Starter Pack"
  39.     SetAbout "KODAK PRECISION MICROGRAFX Starter Pack", "Copyright Eastman Kodak Company"
  40.  
  41.     szInf$ = GetSymbolValue("STF_SRCINFPATH")
  42.     IF szInf$ = "" THEN
  43.         szInf$ = GetSymbolValue("STF_CWDDIR") + "starter.inf"
  44.     END IF
  45.     ReadInfFile szInf$
  46.  
  47.     WinDir$ = GetWindowsDir()
  48.     WinDir$ = MID$(WinDir$, 1, LEN(WinDir$) - 1)
  49.  
  50.     WinSysDir$ = GetWindowsSysDir()
  51.     WinSysDir$ = MID$(WinSysDir$, 1, LEN(WinSysDir$) - 1)
  52.  
  53. '$IFDEF DEBUG
  54.     i% = SetSizeCheckMode(scmOnIgnore)    '' could use scmOff; def = scmOnFatal
  55.     WinDrive$ = MID$(GetWindowsDir, 1, 1)
  56.     IF IsDriveValid(WinDrive$) = 0 THEN
  57.         i% = DoMsgBox("Windows drive ('"+WinDrive$+"') is not a valid drive.", "DEBUG", MB_TASKMODAL+MB_ICONHAND+MB_OK)
  58.         GOTO QUIT
  59.     END IF
  60. '$ENDIF ''DEBUG
  61.  
  62.  
  63. WELCOME:
  64.     sz$ = UIStartDlg(CUIDLL$, WELCOME, "FInfoDlgProc", 0, "")
  65.     IF sz$ = "CONTINUE" THEN
  66.         UIPop 1
  67.     ELSE
  68.         GOSUB ASKQUIT
  69.         GOTO WELCOME
  70.     END IF
  71.  
  72.  
  73. WinVersion:
  74.     IF GetWindowsMajorVersion() < 3 THEN
  75.         sz$ = UIStartDlg(CUIDLL$, WINDOWSVERSION, "FInfoDlgProc", 0, "")
  76.         IF sz$ = "CONTINUE" THEN
  77.             UIPop 1
  78.         ELSE
  79.             GOSUB ASKQUIT
  80.             GOTO WinVersion
  81.         END IF
  82.     ELSE
  83.         IF GetWindowsMinorVersion() < 1 THEN
  84.             sz$ = UIStartDlg(CUIDLL$, WINDOWSVERSION, "FInfoDlgProc", 0, "")
  85.             IF sz$ = "CONTINUE" THEN
  86.                 UIPop 1
  87.             ELSE
  88.                 GOSUB ASKQUIT
  89.                 GOTO WinVersion
  90.             END IF
  91.         END IF
  92.     ENDIF
  93.  
  94.  
  95. WinMode:
  96.     IF GetWindowsMode() < 2 THEN
  97.         sz$ = UIStartDlg(CUIDLL$, WINDOWSMODE, "FInfoDlgProc", 0, "")
  98.         IF sz$ = "CONTINUE" THEN
  99.             UIPop 1
  100.         ELSE
  101.             GOSUB ASKQUIT
  102.             GOTO WinMode
  103.         END IF
  104.     ENDIF
  105.  
  106.  
  107. Processor:
  108.     IF GetProcessorType() < 3 THEN
  109.         sz$ = UIStartDlg(CUIDLL$, PROCESSOR, "FInfoDlgProc", 0, "")
  110.         IF sz$ = "CONTINUE" THEN
  111.             UIPop 1
  112.         ELSE
  113.             GOSUB ASKQUIT
  114.             GOTO Processor
  115.         END IF
  116.     ENDIF
  117.  
  118.  
  119.     Install
  120.  
  121.  
  122. QUIT:
  123.     ON ERROR GOTO ERRQUIT
  124.  
  125.     IF ERR = 0 THEN
  126.         dlg% = EXITSUCCESS
  127.     ELSEIF ERR = STFQUIT THEN
  128.         dlg% = EXITQUIT
  129.     ELSE
  130.         dlg% = EXITFAILURE
  131.     END IF
  132. QUITL1:
  133.     sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
  134.     IF sz$ = "REACTIVATE" THEN
  135.         GOTO QUITL1
  136.     END IF
  137.     UIPop 1
  138.  
  139.     END
  140.  
  141. ERRQUIT:
  142.     i% = DoMsgBox("Setup sources were corrupted, call 800-752-6567 or 508-670-6877", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
  143.     END
  144.  
  145.  
  146.  
  147. ASKQUIT:
  148.     sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
  149.  
  150.     IF sz$ = "EXIT" THEN
  151.         UIPopAll
  152.         ERROR STFQUIT
  153.     ELSEIF sz$ = "REACTIVATE" THEN
  154.         GOTO ASKQUIT
  155.     ELSE
  156.         UIPop 1
  157.     END IF
  158.     RETURN
  159.  
  160.  
  161.  
  162. '**
  163. '** Purpose:
  164. '**     Builds the copy list and performs all installation operations.
  165. '** Arguments:
  166. '**     none.
  167. '** Returns:
  168. '**     none.
  169. '*************************************************************************
  170. SUB Install STATIC
  171.     SrcDir$ = GetSymbolValue("STF_SRCDIR")
  172.  
  173. '** Locate location for CP files
  174.     KpcmsIni$ = MakePath(WinDir$,"kpcms.ini")
  175.  
  176. '** check for kpcms.ini, create default one if not found
  177.     IF 0 = DoesFileExist(KpcmsIni$, femExists) THEN
  178.         KpcmsIniSrc$ = MakePath(SrcDir$,"kpcms.ini")
  179.         CopyFile KpcmsIniSrc$, KpcmsIni$, cmoVital, 0
  180.     ENDIF
  181. '**
  182.  
  183.     Drive$ = GetIniKeyString(KpcmsIni$, "KEPS Precision", "DRIVE")
  184.     IF Drive$ = "" THEN
  185.         Drive$ = "C:"
  186.     ENDIF
  187.  
  188. '** Add DLLs to copy list
  189.     AddSectionKeyFileToCopyList "DllFiles", "Shared", SrcDir$, WinDir$
  190.  
  191. '** Get directory for CP files
  192.     CPDir$ = GetIniKeyString(KpcmsIni$, "KCP", "CP_DIR")
  193.     IF CPDir$ = "" THEN
  194.         CPDir$ = "\kpcms\cmscpi\"
  195.     ENDIF
  196.  
  197.     CPPath$ = Drive$ + CPDir$
  198.     CPPath$ = MID$(CPPath$, 1, LEN(CPPath$) - 1)
  199.     CreateDir CPPath$, cmoVital
  200.  
  201. '** Add CP files to copy list
  202.     AddSectionFilesToCopyList "CPFiles", SrcDir$, CPPath$
  203.  
  204. '** Get directory for PTs
  205.     PTDir$ = GetIniKeyString(KpcmsIni$, "KCP", "PT_DIR")
  206.     IF PTDir$ = "" THEN
  207.         PTDir$ = "\kpcms\dcpdb\"
  208.     ENDIF
  209.     PTPath$ = Drive$ + PTDir$
  210.     CreateDir PTPath$, cmoVital
  211.  
  212. '** Add PT files to copy list
  213.     AddSectionFilesToCopyList "pts", SrcDir$, PTPath$
  214.  
  215. '** Get directory for READMES
  216.     READMESPath$ = PTPath$ + "READMES"
  217.     CreateDir READMESPath$, cmoVital
  218.  
  219. '** Add Readme files to copy list
  220.     AddSectionFilesToCopyList "readmes", SrcDir$, READMESPath$
  221.  
  222.     CopyFilesInCopyList
  223.  
  224. GetOut:
  225. END SUB
  226.  
  227.  
  228.  
  229. '**
  230. '** Purpose:
  231. '**     Appends a file name to the end of a directory path,
  232. '**     inserting a backslash character as needed.
  233. '** Arguments:
  234. '**     szDir$  - full directory path (with optional ending "\")
  235. '**     szFile$ - filename to append to directory
  236. '** Returns:
  237. '**     Resulting fully qualified path name.
  238. '*************************************************************************
  239. FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
  240.     IF szDir$ = "" THEN
  241.         MakePath = szFile$
  242.     ELSEIF szFile$ = "" THEN
  243.         MakePath = szDir$
  244.     ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
  245.         MakePath = szDir$ + szFile$
  246.     ELSE
  247.         MakePath = szDir$ + "\" + szFile$
  248.     END IF
  249. END FUNCTION
  250.